﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class news2 : System.Web.UI.UserControl
{
    public String navigate_url = null;
    public String image_url = null;
    public DataTable dt = null;

    public String Image_url { get { return image_url; } set { image_url = value; } }
    public String Navigate_url { get { return navigate_url; } set { navigate_url = value; } }
    public DataTable Dt { get { return dt; } set { dt = value; } }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public void FetchDataTitle()
    {
        if (dt != null)
        {
            char[] delimiter = { '.' };
            title.Text = dt.Rows[0]["title"].ToString();            
            contentLabel.Text = dt.Rows[0]["details"].ToString().Split(delimiter)[0];
            //contentLabel.Text = test.Split(delimiter)[0];
            Image1.ImageUrl = dt.Rows[0]["image_"].ToString();
            header_link.NavigateUrl = navigate_url + "?id=" + dt.Rows[0]["news_id"].ToString();
            title.NavigateUrl = navigate_url + "?id=" + dt.Rows[0]["news_id"].ToString();
            label_link.NavigateUrl = navigate_url + "?id=" + dt.Rows[0]["news_id"].ToString();
        }
    }
}